package card;

import java.util.ArrayList;
import java.util.List;

import static card.cardMothor.buycard;
import static card.cardMothor.fun;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: adol book
 * Date: 2022-04-28
 * Time: 9:25
 */
public class testcard {
    public static void main(String[] args) {
        List<Card> cards = buycard();
        System.out.println(cards);
        fun(cards);
        System.out.println(cards);
        List<Card> hand1 = new ArrayList<>();
        List<Card> hand2 = new ArrayList<>();
        List<Card> hand3 = new ArrayList<>();
        List<List<Card>> hands = new ArrayList<>(); //二维数组
        hands.add(hand1); //三个人
        hands.add(hand2);
        hands.add(hand3);
        for (int i = 0; i < 10; i++) { //每个人拿到的拍数
            for (int j = 0; j < 3; j++) { //三个人
                Card card = cards.remove(0); //相当于删除，从0下标拿起
                List<Card> hand = hands.get(j); //拿到三个人拿到的牌数，
                hand.add(i,card);
            }
        }
        System.out.println("第一个人的牌"+hand1);
        System.out.println("第一个人的牌"+hand2);
        System.out.println("第一个人的牌"+hand3);
        System.out.println("剩余的牌"+cards);
    }
}
